//
//  LSZSharingTypeTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/6/5.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZSharingTypeTableViewCell.h"

@implementation LSZSharingTypeTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.butCircleFriends = [[UIButton alloc]init];
        [self addSubview:self.butCircleFriends];
        self.imageViewCircleFriends = [[UIImageView alloc]init];
        self.imageViewCircleFriends.image = [UIImage imageNamed:@"我的_微信朋友圈"];
        [self.butCircleFriends addSubview:self.imageViewCircleFriends];
        self.labelCircleFriends = [[UILabel alloc]init];
        self.labelCircleFriends.textColor = titleColorLSZ;
        self.labelCircleFriends.text = @"朋友圈";
        self.labelCircleFriends.textAlignment = NSTextAlignmentCenter;
        [self.butCircleFriends addSubview:self.labelCircleFriends];

        self.butMicroLetter = [[UIButton alloc]init];
        [self addSubview:self.butMicroLetter];
        self.imageViewMicroLetter = [[UIImageView alloc]init];
        self.imageViewMicroLetter.image = [UIImage imageNamed:@"我的_微信好友"];
        [self.butMicroLetter addSubview:self.imageViewMicroLetter];
        self.labelMicroLetter = [[UILabel alloc]init];
        self.labelMicroLetter.textColor = titleColorLSZ;
        self.labelMicroLetter.text = @"微信邀请";
        self.labelMicroLetter.textAlignment = NSTextAlignmentCenter;
        [self.butMicroLetter addSubview:self.labelMicroLetter];

        self.butQQ = [[UIButton alloc]init];
        [self addSubview:self.butQQ];
        self.imageViewQQ = [[UIImageView alloc]init];
        self.imageViewQQ.image = [UIImage imageNamed:@"我的_QQ"];
        [self.butQQ addSubview:self.imageViewQQ];
        self.labelQQ = [[UILabel alloc]init];
        self.labelQQ.textColor = titleColorLSZ;
        self.labelQQ.text = @"QQ邀请";
        self.labelQQ.textAlignment = NSTextAlignmentCenter;
        [self.butQQ addSubview:self.labelQQ];

        self.butQrCode = [[UIButton alloc]init];
        [self addSubview:self.butQrCode];
        self.imageViewQrCode = [[UIImageView alloc]init];
        self.imageViewQrCode.image = [UIImage imageNamed:@"我的_二维码"];
        [self.butQrCode addSubview:self.imageViewQrCode];
        self.labelQrCode = [[UILabel alloc]init];
        self.labelQrCode.textColor = titleColorLSZ;
        self.labelQrCode.text = @"二维码邀请";
        self.labelQrCode.textAlignment = NSTextAlignmentCenter;
        [self.butQrCode addSubview:self.labelQrCode];

        if (ScreenWidth == 320) {
            //5
            self.labelCircleFriends.font = FONT_(13);
            self.labelMicroLetter.font = FONT_(13);
            self.labelQQ.font = FONT_(13);
            self.labelQrCode.font = FONT_(13);

            self.butCircleFriends.frame = CGRectMake(0,0, ScreenWidth/4,54);
            self.imageViewCircleFriends.frame  = CGRectMake((self.butCircleFriends.frame.size.width-22)/2,8, 22, 22);
            self.labelCircleFriends.frame = CGRectMake(0,CGRectGetMaxY(self.butCircleFriends.frame)-8-13, self.butCircleFriends.frame.size.width, 13);

            self.butMicroLetter.frame = CGRectMake(ScreenWidth/4,0, ScreenWidth/4,54);
            self.imageViewMicroLetter.frame  = CGRectMake((self.butMicroLetter.frame.size.width-22)/2,8, 22, 22);
            self.labelMicroLetter.frame = CGRectMake(0,CGRectGetMaxY(self.butMicroLetter.frame)-8-13, self.butMicroLetter.frame.size.width, 13);

            self.butQQ.frame = CGRectMake(ScreenWidth/2,0, ScreenWidth/4,54);
            self.imageViewQQ.frame  = CGRectMake((self.butQQ.frame.size.width-22)/2,8, 22, 22);
            self.labelQQ.frame = CGRectMake(0,CGRectGetMaxY(self.butQQ.frame)-8-13, self.butQQ.frame.size.width, 13);

            self.butQrCode.frame = CGRectMake(ScreenWidth/4*3,0, ScreenWidth/4,54);
            self.imageViewQrCode.frame  = CGRectMake((self.butQrCode.frame.size.width-22)/2,8, 22, 22);
            self.labelQrCode.frame = CGRectMake(0,CGRectGetMaxY(self.butQrCode.frame)-8-13, self.butQrCode.frame.size.width, 13);

        }else if(ScreenWidth == 375){
            // 6 7
            self.labelCircleFriends.font = FONT_(13.5);
            self.labelMicroLetter.font = FONT_(13.5);
            self.labelQQ.font = FONT_(13.5);
            self.labelQrCode.font = FONT_(13.5);

            self.butCircleFriends.frame = CGRectMake(0,0, ScreenWidth/4,60);
            self.imageViewCircleFriends.frame  = CGRectMake((self.butCircleFriends.frame.size.width-24)/2,9, 24, 24);
            self.labelCircleFriends.frame = CGRectMake(0,CGRectGetMaxY(self.butCircleFriends.frame)-9-15, self.butCircleFriends.frame.size.width, 15);

            self.butMicroLetter.frame = CGRectMake(ScreenWidth/4,0, ScreenWidth/4,60);
            self.imageViewMicroLetter.frame  = CGRectMake((self.butMicroLetter.frame.size.width-24)/2,9, 24, 24);
            self.labelMicroLetter.frame = CGRectMake(0,CGRectGetMaxY(self.butMicroLetter.frame)-9-15, self.butMicroLetter.frame.size.width, 15);

            self.butQQ.frame = CGRectMake(ScreenWidth/2,0, ScreenWidth/4,60);
            self.imageViewQQ.frame  = CGRectMake((self.butQQ.frame.size.width-24)/2,9, 24, 24);
            self.labelQQ.frame = CGRectMake(0,CGRectGetMaxY(self.butQQ.frame)-9-15, self.butQQ.frame.size.width, 15);

            self.butQrCode.frame = CGRectMake(ScreenWidth/4*3,0, ScreenWidth/4,60);
            self.imageViewQrCode.frame  = CGRectMake((self.butQrCode.frame.size.width-24)/2,9, 24, 24);
            self.labelQrCode.frame = CGRectMake(0,CGRectGetMaxY(self.butQrCode.frame)-10-15, self.butQrCode.frame.size.width, 15);
        }else {
            //plus
            self.labelCircleFriends.font = FONT_(14);
            self.labelMicroLetter.font = FONT_(14);
            self.labelQQ.font = FONT_(14);
            self.labelQrCode.font = FONT_(14);

            self.butCircleFriends.frame = CGRectMake(0,0, ScreenWidth/4,68);
            self.imageViewCircleFriends.frame  = CGRectMake((self.butCircleFriends.frame.size.width-26)/2,9, 26, 26);
            self.labelCircleFriends.frame = CGRectMake(0,CGRectGetMaxY(self.butCircleFriends.frame)-9-17, self.butCircleFriends.frame.size.width, 17);

            self.butMicroLetter.frame = CGRectMake(ScreenWidth/4,0, ScreenWidth/4,68);
            self.imageViewMicroLetter.frame  = CGRectMake((self.butMicroLetter.frame.size.width-26)/2,9, 26, 26);
            self.labelMicroLetter.frame = CGRectMake(0,CGRectGetMaxY(self.butMicroLetter.frame)-9-17, self.butMicroLetter.frame.size.width, 17);

            self.butQQ.frame = CGRectMake(ScreenWidth/2,0, ScreenWidth/4,68);
            self.imageViewQQ.frame  = CGRectMake((self.butQQ.frame.size.width-26)/2,9, 26, 26);
            self.labelQQ.frame = CGRectMake(0,CGRectGetMaxY(self.butQQ.frame)-9-17, self.butQQ.frame.size.width, 17);

            self.butQrCode.frame = CGRectMake(ScreenWidth/4*3,0, ScreenWidth/4,68);
            self.imageViewQrCode.frame  = CGRectMake((self.butQrCode.frame.size.width-26)/2,9, 26, 26);
            self.labelQrCode.frame = CGRectMake(0,CGRectGetMaxY(self.butQrCode.frame)-10-17, self.butQrCode.frame.size.width, 17);
        }

        UIView * viewLine = [[UIView alloc]initWithFrame:CGRectMake(20, 0, ScreenWidth-40, 0.3)];
        viewLine.backgroundColor = divider;
        [self addSubview:viewLine];

    }
    return self;
}
@end
